package com.yiqi.lottery.feature.basketball.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.suozhang.framework.entity.bo.PageData;
import com.yiqi.lottery.entity.bo.BallMatchBo;
import com.yiqi.lottery.entity.bo.BallMatchBo2;
import com.yiqi.lottery.feature.basketball.contract.BasketballContract;
import com.yiqi.lottery.feature.basketball.dependencies.basketball.DaggerBasketballModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.BasketballApi;
import javax.inject.Inject;
import io.reactivex.Observable;

public class BasketballModel implements BasketballContract.Model {

    @Inject
    BasketballApi api;


    @Inject
    public BasketballModel() {
        DaggerBasketballModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<PageData<BallMatchBo>> getBasketballMatchList(String label) {
        return api.getBasketballMatch(label).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<PageData<BallMatchBo2>> getBasketballMatchList2(String label) {
        return api.getBasketballMatch2(label).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
